@import '../../../../common/_utils/style/mixins/mixins.scss';
@import '../../../../common/_utils/style/theme/theme.scss';
@import '../../../../common/empty/style/empty.scss';

@include b(tdtRoutePlan) {
  $tabs-prefix: #{$ant-prefix}-tabs;
  
  background: $collapse-card-secondary-bg;
  font-size: 12px;
  padding: 0 16px;

  .route-icon {
    width: 16px;
    height: 16px;
    background: url("#{$--tdt-assets-path}/sprite.png");
    background-repeat: no-repeat;
    display: inline-block;
  }
  &.route-bus-plan {
    .#{$tabs-prefix}-tab {
      width: 25% !important;
    }
  }
  &.#{$tabs-prefix}.#{$tabs-prefix}-card .#{$tabs-prefix}-card-bar .#{$tabs-prefix}-tab {
    padding: 0;
    width: 33%;
    height: 28px;
    text-align: center;
    margin-right: 0;
    line-height: 26px;
    font-size: 12px;
    border-radius: 0;
    background: transparent;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    &.#{$tabs-prefix}-tab-active {
      border-color: $primary-color;
      border-right-color: $primary-color;
    }
    &:not(.#{$tabs-prefix}-tab-active) {
      border-style: dashed;
    }
    &:not(:last-child):not(.#{$tabs-prefix}-tab-active) {
      border-right-color: transparent;
    }
    &:first-child {
      border-radius: 4px 0 0 4px;
    }
    &:last-child {
      border-radius: 0 4px 4px 0;
    }
  }
  &.#{$tabs-prefix} .#{$tabs-prefix}-small-bar .#{$tabs-prefix}-tab {
    padding: 0;
  }
  .#{$tabs-prefix}-nav {
    width: 100%;
  }
  .#{$tabs-prefix}-bar {
    margin: 12px 0;
    border-bottom: none;
  }
  &.#{$tabs-prefix}.#{$tabs-prefix}-card .#{$tabs-prefix}-card-bar .#{$tabs-prefix}-nav-container {
    height: 28px;
  }
  .distance {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .#{$ant-prefix}-checkbox-wrapper {
    font-size: 12px;
    color: inherit;
  }
  li,
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: 20px;
  }
  .line-details {
    position: relative;
    margin-top: 12px;
    &::after {
      content: '';
      position: absolute;
      top: 16px;
      bottom: 15px;
      left: 8px;
      border-left: 1px dashed $border-color-split;
    }
    .level-2 {
      margin-top: 16px;
    }
  }
  .walk {
    width: 9px;
    height: 16px;
    background-position: -242px -184px;
  }
  .bus {
    width: 14px;
    height: 16px;
    background-position: -148px -183px;
  }
  .metro {
    width: 12px;
    height: 16px;
    background-position: -220px -184px;
  }
  .line-info {
    span {
      padding: 0 8px;
      &:first-child {
        padding-left: 0;
      }
      &:nth-of-type(2) {
        border: 1px solid $border-color-split;
        border-top: none;
        border-bottom: none;
      }
    }
  }
  .line-name {
    margin-bottom: 4px;
    & > div {
      display: inline-flex;
      align-items: center;
      > i {
        margin-right: 9px;
      }
    }
  }
  .right-direction {
    margin: 0 6px;
    font-weight: 700;
  }
  .icon-holder {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    text-align: center;
    .icon {
      display: inline-block;
    }
  }
  .icon {
    width: 10px;
    height: 10px;
    border-radius: 5px;
  }
  .start-label {
    .icon {
      background: #2BA250;
    }
    .name {
      display: inline-block;
      max-width: 110px;
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
    }
  }
  .dest-label {
    .icon {
      background: #E5666F;
    }
  }
  .start-label, .dest-label, .start-position-title, .dest-position-title {
    display: flex;
    align-items: center;
    line-height: 20px;
  }
  .start-position-title, .dest-position-title {
    i {
      display: block;
      margin-right: 8px;
    }
  }
  .start-position-title {
    margin-bottom: 4px;
    i {
      border: 1px solid #2BA250;
    }
  }
  .dest-position-title {
    margin: 8px 0;
    i {
      border: 1px solid #E5666F;
    }
  }
  .level-1 {
    & > li {
      padding: 8px 0;
      border-top: 1px solid $border-color-split;
      &:hover {
        cursor: pointer;
        background: $tdt-route-plan-hover-bg;
        color: $primary-color;
      }
      &.detail-item {
        > div {
          color: $primary-color;
          margin-bottom: 8px;
        }
      }
      &:last-of-type {
        border-bottom: 1px solid $border-color-split;
      }
      &.bus-info {
        .level-2 {
          li {
            margin-bottom: 16px;
            overflow: hidden;
            > * {
              &:not(.station-count) {
                float: left;
              }
              &.station-count {
                float: right;
              }
            }
          }
        }
      }
      &.car-info {
        .level-2 {
          li {
            padding-left: 13px;
            padding-bottom: 8px;
            &:last-of-type {
              padding-bottom: 0;
              &::after {
                display: none;
              }
            }
            &::before {
              content: '';
              position: absolute;
              left: 0;
              top: 6px;
              width: 5px;
              height: 5px;
              border-radius: 50%;
              background: #2BA250;
            }
            &::after {
              content: '';
              position: absolute;
              top: 11px;
              bottom: -5px;
              left: 2px;
              border-left: 1px dashed $border-color-split;
            }
          }
        }
      }
      .line-header {
        cursor: pointer;
        line-height: 20px;
      }
    }
  }
  .level-2 {
    li {
      position: relative;
      cursor: pointer;
      a {
        text-decoration: none;
        color: $primary-color;
      }
    }
  }
  .route-plan-container {
    /* overflow: scroll;
      max-height: 480px;
      overflow-x: hidden; */
    .dest-label span {
      display: inline-block;
      max-width: 80%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 12px;
      cursor: pointer;
    }
  }
  .loading-and-tip-holder {
    text-align: center;
    padding: 6px 0;
  }
  .#{$ant-prefix}-empty {
    background-color: transparent;
    margin: 0;
    font-size: 12px;
  }
}

.route-plan-popup {
  color: $text-color;
  font-size: 12px;
  line-height: 20px;
  .info_container {
    cursor: default;
    word-wrap: break-word;
    p {
      margin: 0;
      margin-top: 8px;
    }
    .title {
      border-bottom: 1px solid $border-color-split;
      color: $heading-color;
    }
  }
  .mapboxgl-popup-content {
    background: $collapse-card-bg;
  }
}
